home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 25
/
AACD 25.iso
/
AACD
/
Magazine
/
Installer
/
Example2
< prev
next >
Wrap
Text File
|
2001-09-03
|
3KB
|
134 lines
; Procedures
;;; Copy the program and docs
(procedure CopylibAll #SrcDir #DestDir
(message (cat 'Source: ' #SrcDir '\nDest: ' #DestDir))
(foreach #SrcDir '#?'
(
(if (> @each-type 0)
(CopyLibAll (tackon #SrcDir @each-name) (tackon #DestDir @each-name))
(
(if (NOT (exists #DestDir)) (makedir #DestDir))
(copylib
(prompt (cat 'Copying ' @each-name ' to ' #DestDir))
(help #InstallHelp)
(source (tackon #SrcDir @each-name))
(dest #DestDir)
(confirm)
(infos)
)
)
)
)
)
)
;;;
;;; Set tooltypes
(set #PicPath 'Pictures:')
(procedure SetupTooltypes
(tooltype
(dest (tackon #DestDir 'MyProg'))
(settooltype 'PicturePath' #PicPath)
(settooltype 'BrushPath' #PicPath)
)
)
;;;
;;; Create config file
(procedure WriteConfig
(textfile
(dest (tackon #DestDir 'MyProg.cfg'))
(include (tackon #DestDir 'MyProg.cfg'))
(append (cat 'MailAddress=' #MailAddress '\n'))
(append (cat 'POP3server=' #POP3 '\n'))
(append (cat 'SMTPserver=' #SMTP '\n'))
(append (cat 'Login=' #Login '\n'))
(append (cat 'Password=' #Password '\n'))
(include 'Defaults.cfg')
)
)
;;;
;;; Set language strings
(procedure SetLanguage
(SetEnglish)
(if (= @language 'français') (SetFrench))
(if (= @language 'deutsch') (SetGerman))
)
(procedure SetEnglish
(set #Hello 'Hi there')
)
(procedure SetFrench
(set #Hello 'Bonjour')
)
(procedure SetGerman
(set #Hello 'Guten tag')
)
;;;
;;; Check system meets minimum requirements
(procedure CheckSystem
(set #CPUPrompt 'Which processor would you like to install for?')
; Check OS version
(set #RC (run "version version 39"))
(if (= #RC 5) (abort #MinOSError))
; Check memory
(set #TotalRAM (+ (database "total-mem")))
(if (< #TotalRam #MinRAM) (abort #MinMemError))
; Check CPU
(set #CPU (database "cpu"))
(if
(< #CPU "68020")
(abort #MinCPUError)
)
(set #DefCPU 0)
(if (= #CPU "68030") (set #DefCPU 1))
(if (= #CPU "68040") (set #DefCPU 2))
(if (= #CPU "68060") (set #DefCPU 3))
(set #CPUPrompt (cat 'Installer has detected a ' #CPU ' processor.\n\n' #CPUPrompt))
(set #CPUchoice
(askchoice
(prompt #CPUPrompt)
(help #CPUHelp)
(choices
'\x1B[2p68020'
'68030'
'68040'
'68060'
)
(default #DefCPU)
)
)
(set #CPUext (select #CPUchoice ("") (".030") (".040") (".060")))
)
;;;
;;; Show Images
(procedure ShowImages
(showmedia 'testpic0' 'images/testpic.gif' 'upper_right' 'none' 0)
(showmedia 'testpic1' 'images/AACDmain.gif' 'upper_left' 'none' 0)
(showmedia 'testpic2' 'images/aamain1.jpeg' 'upper_center' 'none' 0)
(showmedia 'testpic3' 'images/SideMag.gif' 'lower_left' 'none' 0)
(showmedia 'testpic4' 'images/SideSearch.gif' 'lower_right' 'none' 0)
(showmedia 'testpic5' 'images/Top.gif' 'lower_center' 'none' 0)
)
;;;
;;; Remove images
(procedure RemoveImages
(closemedia testpic0)
(closemedia testpic1)
(closemedia testpic2)
(closemedia testpic3)
(closemedia testpic4)
(closemedia testpic5)
)
;;;
; Main install
(effect 'center' 'horizontal' $ff0000 $0000ff)
(SetLanguage)
(ShowImages)
(CheckSystem)
(RemoveImages)
(exit (quiet))